//
//  KindReusableView.m
//  MarianasTrench
//
//  Created by 王晓晨 on 16/3/17.
//  Copyright © 2016年 王爵. All rights reserved.
//

#import "KindReusableView.h"

@implementation KindReusableView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        
        [self createSubViews];
        self.backgroundColor = [UIColor whiteColor];
        
    }return self;
}

- (void)createSubViews {
    
    self.bookButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.bookButton.showsTouchWhenHighlighted = YES;
    _bookButton.frame = CGRectMake(10, 10, self.frame.size.height - 20, self.frame.size.height - 20);
    [self addSubview:_bookButton];
    
    
    self.musicButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.musicButton.showsTouchWhenHighlighted = YES;
    _musicButton.frame = CGRectMake(5 + _bookButton.frame.origin.x + _bookButton.frame.size.width, _bookButton.frame.origin.y, (self.frame.size.width - 30) / 4, (self.frame.size.height - 25) / 2);
    [self addSubview:_musicButton];
    
    
    self.crosstalkButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.crosstalkButton.showsTouchWhenHighlighted = YES;
    _crosstalkButton.frame = CGRectMake(_musicButton.frame.origin.x, _musicButton.frame.origin.y + _musicButton.frame.size.height + 5, _musicButton.frame.size.width, _musicButton.frame.size.height);
    [self addSubview:_crosstalkButton];
    
    
    self.amuseButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.amuseButton.showsTouchWhenHighlighted = YES;
    _amuseButton.frame = CGRectMake(5 + _musicButton.frame.origin.x + _musicButton.frame.size.width, _musicButton.frame.origin.y, _musicButton.frame.size.width, _musicButton.frame.size.height);
    [self addSubview:_amuseButton];
    
    
    self.childButton = [UIButton buttonWithType:UIButtonTypeCustom];
    self.childButton.showsTouchWhenHighlighted = YES;
    _childButton.frame = CGRectMake(_amuseButton.frame.origin.x, _crosstalkButton.frame.origin.y, _amuseButton.frame.size.width, _amuseButton.frame.size.height);
    [self addSubview:_childButton];
    
}

@end
